<script setup>
import { inject } from 'vue';


const money =  inject('money')
const car = inject('car')
const changeCar = inject('changeCar')

console.log(money)
console.log(car.value)
</script>

<template>
  <div class="child-page" style="padding: 50px; border: 10px solid #ccc">
  child 组件
  <p>钱包: {{ money }}</p>
  <p>车: {{ car }}</p>
  <button @click="changeCar('自行车')">换车</button>
  </div>
</template>

<style scoped></style>